import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const store = new Vuex.Store({
    state: {
      nickname: '未设置',
      userAddress: {} ,// 用户地址
	  myUserInfo:{
		  birthday:"",
		  realName:"",
		  storeDistance:"",
		  city:"",
		  sex:"",
		  provice:"",
		  district:"",
		  liveWay:"",
		  storeName:"",
		  storeId:"",
		  invitationCode:"",
		  isAddWeixin:""
	  }
    },
    mutations: {
      addAddress (state,addressObj) {
        state.userAddress = addressObj
      },
	  savemyUserInfo(state,info){
		  // state.myUserInfo = info;
		  state.myUserInfo.birthday = info.birthday;
		  state.myUserInfo.realName = info.realName
		  state.myUserInfo.storeDistance = info.storeDistance
		  state.myUserInfo.city = info.city
		  state.myUserInfo.provice = info.provice
		  state.myUserInfo.district = info.district
		  state.myUserInfo.sex = info.sex
		  state.myUserInfo.liveWay = info.liveWay
		  state.myUserInfo.storeName = info.storeName
		  state.myUserInfo.storeId = info.storeId
		  state.myUserInfo.invitationCode = info.invitationCode
		  state.myUserInfo.isAddWeixin = info.isAddWeixin
	  }
    }
  })
  export default store
   